﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using Lib.Utilities;

public partial class f_xembc : Page
{
    private string b_kieu_in = "";
    private DataSet b_kq;


    private string Fs_thumuc()
    {
        string relativeUrl = "~/menu.aspx";
        string str2 = base.ResolveUrl(relativeUrl);
        return str2.Substring(0, (str2.Length + 1) - relativeUrl.Length);
    }

    protected void Page_Init(object sender, EventArgs e)
    {
        this.b_kieu_in = base.Request.QueryString["kieu_in"];
        this.b_kq = (DataSet)HttpContext.Current.Session["kq_ds"];
        if (b_kq.Tables.Count == 0)
        {
            string b_url = LibConvert.ObjectToString(Session["url"]);
            if (b_url != null)
                Response.Redirect(b_url, false);
            return;
        }


        if (this.b_kieu_in == "E")
        {
            UtilsExcel.ExportToExcel("", this.b_kq, base.Server.MapPath("~/Templates/excel_sl.xlsx"), this.Page.Response);
            return;
        }
    }
}